package com.transaction.factory;

import cn.hutool.extra.spring.SpringUtil;
import com.transaction.repository.MyRepository;
import org.springframework.stereotype.Component;

@Component("factory1")
public class Factory1 implements Factory {
    @Override
    public void insertData(String name) {
        MyRepository myRepository = SpringUtil.getBean(MyRepository.class);
        // 模拟数据库操作
        myRepository.insertData("工厂实例里面");
    }
}
